package list_map;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Properties;

/**
 * @program: javase
 * @description: hashTable子类
 * @author: lld
 * @create: 2020-11-09 19:18
 **/
public class PropertiesDemo {
    public static void main(String[] args) throws IOException {
        Properties properties=new Properties();

        FileInputStream inputStream=new FileInputStream("other/jdbc.properties");
        properties.load(inputStream);
        String name = properties.getProperty("name");
        System.out.println(name);
        //通过Enumeration
        Enumeration<Object> elements = properties.elements();
        while (elements.hasMoreElements()){
            System.out.println(elements.nextElement());
        }

    }
}
